<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/backend/common/taglib.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/backend/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<base href="<%=basePath%>">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>后台管理工作平台</title>
<link rel="stylesheet" href="common/page.css" type="text/css"></link>
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
	$(function(){
		$("#selectAll").click(function(){
		     var c = $(this).attr("checked");
		     $("input[name='ids']").attr("checked",c);
		});
		
	})
	function del(){
		if(window.confirm("确定删除？")){
			$("#deleteForm").submit();
		}
	}
</script>
</head>
<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="24" bgcolor="#353c44"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="6%" height="19" valign="bottom"><div align="center"><img src="images/tb.gif" width="14" height="14" /></div></td>
                <td width="94%" valign="bottom"><span class="STYLE1"> 角色列表</span></td>
              </tr>
            </table></td>
            <td>
            	<div align="right">
            	 <span class="STYLE1">
	             &nbsp;	<img src="images/add.gif" width="10" height="10" /> <a href="role!preSave.action">添加</a>   
	             &nbsp; <img src="images/del.gif" width="10" height="10" /> <a href="javascript:del()">删除</a>    &nbsp;&nbsp;
	             </span>
	             <span class="STYLE1"> &nbsp;</span>
             	</div>
             </td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td>
    <form action="role!delete.action" id="deleteForm" method="post">
    <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#a8c7ce">
      <tr>
        <td width="4%" height="20" bgcolor="d3eaef" class="STYLE10">
	        <div align="center">
	          <input type="checkbox" name="checkbox" id="selectAll" />
	        </div>
        </td>
        <td width="200" height="20" bgcolor="d3eaef" class="STYLE6">
        		<div align="center"><span class="STYLE10">角色名</span></div>
        </td>
        <td width="200" height="20" bgcolor="d3eaef" class="STYLE6">
        		<div align="center"><span class="STYLE10">基本操作</span></div>
        </td>
      </tr>
      
      <c:if test="${not empty pagination.data}">
      <c:forEach items="${pagination.data}" var="c">
      <tr>
        <td height="20" bgcolor="#FFFFFF">
	        <div align="center">
	        	<input type="checkbox" name="ids" value="${c.id }"/>
	        </div>
        </td>
        <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><a href="role!get.action?id=${c.id}" title="点击查看角色">${c.name }</a></div></td>
        <td height="20" bgcolor="#FFFFFF">
	        <div align="center" class="STYLE21">
		        <a href="role!delete.action?id=${c.id}" title="点击删除角色">删除</a> |
		        <a href="role!preUpdate.action?id=${c.id}" title="点击编辑角色">编辑</a>
	        </div>
        </td>
      </tr>
      </c:forEach>
      </c:if>
      
      <c:if test="${empty pagination.data}">
      <tr>
          <td height="20" colspan="2" bgcolor="#FFFFFF" class="STYLE19"><div align="center">没有角色可以显示</div></td>
      </tr>
      </c:if>
      
    </table>
    </form>
    </td>
  </tr>
  
  <tr>
    <td height="30">
		<jsp:include page="/backend/common/pager.jsp">
			<jsp:param name="url" value="role.action"/>
		</jsp:include>
 	</td>
  </tr>
  
</table>
</body>
</html>

